package com.wn32.main.demo20;

import java.sql.Timestamp;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.UUID;

public class Main {
    public static void main(String[] args) {
        Date date = new Date();
        System.out.println("date="+date.toString());
        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
        String s = format.format(date);
        System.out.println("s="+s);
        try {
            Date date1 = format.parse(s);
            System.out.println("date1="+date1.toString());
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
}
